﻿using Furion.Extras.Admin.NET;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Admin.NET.Core
{
    /// <summary>
    /// 外部用户关联
    /// </summary>
    [Table("sys_outer_user")]
    [Index(nameof(TenantId), nameof(Platform), nameof(UnionId), IsUnique = true)]
    public class SysOuterUser : DEntityTenant
    {
        /// <summary>
        /// 外部平台
        /// </summary>
        public OuterPlatform Platform { get; set; }

        /// <summary>
        /// 外部用户ID
        /// </summary>
        [MaxLength(50)]
        [Required]
        public string UnionId { get; set; }

        /// <summary>
        /// OpenID
        /// </summary>
        [MaxLength(50)]
        public string OpenId { get; set; }

        public long UserId { get; set; }
        /// <summary>
        /// 关联用户
        /// </summary>]
        public SysUser User { get; set; }
    }
}
